package com.wsl.aop.dynamic;

import com.wsl.aop.pattern.RealSubject;
import com.wsl.aop.pattern.Subject;

import java.lang.reflect.Proxy;

/**
 * @author ：wangshuliang
 * @date ：Created in 2019/6/5 8:09
 * @description：动态代理client
 * @modified By：
 */
public class Client {
    public static void main(String[] args) {
        Subject subject = (Subject) Proxy.newProxyInstance(Client.class.getClassLoader(),new Class[]{Subject.class},
                new JdkProxySubject(new RealSubject()));
        subject.request();
        System.out.println("该执行hello了");
        subject.hello();
    }
}
